﻿using System.Collections.Generic;
using CommonLibrary;

namespace ShuntingScheduleUserControl
{
    public class DrawContext
    {
        public bool DrawConnectionLine { get; set; } = true;

        /// <summary>
        /// 股道宽度，可调节比例
        /// </summary>
        public int NodeHeight { get; } = 30;

        public int NodeWordsWidth { get; } = 300;

        public int TimeWordsWidth { get; } = 20;

        public int HourWidth { get; } = 60 * 2;

        public int ShuntingScheduleHeight { get; } = 10;

        //纵坐标
        public int PlanStartMinuteCnt { get; } = Sys.PlanStartHourCnt;

        public int PlanStopMinuteCnt { get; } = Sys.PlanStopHourCnt;
        public bool DrawPosLine { get; set; } = true;

        public Dictionary<int, float> NodeYDictionary = new Dictionary<int, float>();

        public float GetScheduleX(int time)
        {
            return NodeWordsWidth + time * HourWidth / 60;
        }

        public float GetScheduleY(int schedule1MachId)
        {
            return NodeYDictionary[schedule1MachId];
        }
    }
}